package tech.yangzhijie.basic.knowledge.proxy;

public class TestProxy {

    public static void main(String[] args) {
        DynamicProxy dynamicProxy = new DynamicProxy();
        HouseSubjectA houseSubjectA = new HouseSubjectA();
        HouseSubjectB houseSubjectB = new HouseSubjectB();
        HouseSubject a = (HouseSubject) dynamicProxy.newProxyInstance(houseSubjectA);
        HouseSubject b = (HouseSubject) dynamicProxy.newProxyInstance(houseSubjectB);

        a.rentHouse();
        b.rentHouse();

    }
}
